<!DOCTYPE html>
<html lang="zh-CN">
    <head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
    <meta charset="UTF-8" />

    <meta name="generator" content="Hugo 0.89.4" /><meta name="theme-color" content="#fff" />
    <meta name="color-scheme" content="light dark">

    
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    
    <meta name="format-detection" content="telephone=no, date=no, address=no, email=no" />
    
    <meta http-equiv="Cache-Control" content="no-transform" />
    
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>Nginx 配置文件 | 徐曙辉个人博客</title>

    <link rel="stylesheet" href="../../css/meme.min.a21244848d8f04e61ff40a277d5e095a8bbb49197f3515d558222d8936b0fc13.css"/>

    
    
        <script src="../../js/meme.min.883a355335df5c9f19d469cd25bb68215497fd354fb3a8699eaf851799c161a8.js"></script>

    

    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />

        <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto&#43;Serif&#43;SC:wght@400;500;700&amp;family=Source&#43;Code&#43;Pro:ital,wght@0,400;0,700;1,400;1,700&amp;family=Cinzel&#43;Decorative:wght@700&amp;display=swap" media="print" onload="this.media='all'" />
        <noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto&#43;Serif&#43;SC:wght@400;500;700&amp;family=Source&#43;Code&#43;Pro:ital,wght@0,400;0,700;1,400;1,700&amp;family=Cinzel&#43;Decorative:wght@700&amp;display=swap" /></noscript>

    <meta name="author" content="" /><meta name="description" content="nginx 配置文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37……" />

    <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" />
    <link rel="mask-icon" href="../../icons/safari-pinned-tab.svg" color="#2a6df4" />
    <link rel="apple-touch-icon" sizes="180x180" href="../../icons/apple-touch-icon.png" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-title" content="徐曙辉个人博客" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="mobile-web-app-capable" content="yes" />
    <meta name="application-name" content="徐曙辉个人博客" />
    <meta name="msapplication-starturl" content="../../" />
    <meta name="msapplication-TileColor" content="#fff" />
    <meta name="msapplication-TileImage" content="../../icons/mstile-150x150.png" />
    <link rel="manifest" href="../../manifest.json" />

    
    

    
    <link rel="canonical" href="http://blog.phpst.cn/posts/nginx%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/" />
    

<script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "BlogPosting",
        "datePublished": "2019-04-03T09:40:29+00:00",
        "dateModified": "2021-12-14T14:36:01+08:00",
        "url": "http://blog.phpst.cn/posts/nginx%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/",
        "headline": "Nginx 配置文件",
        "description": "nginx 配置文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37……",
        "inLanguage" : "zh-CN",
        "articleSection": "posts",
        "wordCount":  1668 ,
        "image": "http://blog.phpst.cn/icons/apple-touch-icon.png",
        "author": {
            "@type": "Person",
            "description": "热爱可抵岁月漫长",
            "email": "474497097@qq.com",
            "image": "http://blog.phpst.cn/icons/apple-touch-icon.png",
            "url": "http://blog.phpst.cn/",
            
        },
        "license": "© [WTFPL](/license.txt)",
        "publisher": {
            "@type": "Organization",
            "name": "徐曙辉个人博客",
            "logo": {
                "@type": "ImageObject",
                "url": "http://blog.phpst.cn/icons/apple-touch-icon.png"
            },
            "url": "http://blog.phpst.cn/"
        },
        "mainEntityOfPage": {
            "@type": "WebSite",
            "@id": "http://blog.phpst.cn/"
        }
    }
</script>

    

<meta name="twitter:card" content="summary" />


    



<meta property="og:title" content="Nginx 配置文件" />
<meta property="og:description" content="nginx 配置文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37……" />
<meta property="og:url" content="http://blog.phpst.cn/posts/nginx%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/" />
<meta property="og:site_name" content="徐曙辉个人博客" />
<meta property="og:locale" content="zh" /><meta property="og:image" content="http://blog.phpst.cn/icons/apple-touch-icon.png" />
    <meta property="og:type" content="article" />
    <meta property="article:published_time" content="2019-04-03T09:40:29&#43;00:00" />
    <meta property="article:modified_time" content="2021-12-14T14:36:01&#43;08:00" />
    
    <meta property="article:section" content="posts" />


        <meta name="google-site-verification" content="IATMfE8Ezj4eycW-7BtKg7DRCmvEWP1D2f_lyh797bQ" />
        <link rel="preconnect" href="https://www.google-analytics.com" crossorigin />

        


    
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-154589824-2"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'UA-154589824-2');
    </script>




    
    

    
</head>

    <body>
        <div class="container">
            
    <header class="header">
        
            <div class="header-wrapper">
                <div class="header-inner single">
                    
    <div class="site-brand">
        
            <a href="../../" class="brand">徐曙辉个人博客</a>
        
    </div>

                    <nav class="nav">
    <ul class="menu" id="menu">
        
            
        
        
        
        
            
                <li class="menu-item"><a href="../../posts/"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon posts"><path d="M32 448c0 17.7 14.3 32 32 32h384c17.7 0 32-14.3 32-32V160H32v288zm160-212c0-6.6 5.4-12 12-12h104c6.6 0 12 5.4 12 12v8c0 6.6-5.4 12-12 12H204c-6.6 0-12-5.4-12-12v-8zM480 32H32C14.3 32 0 46.3 0 64v48c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16V64c0-17.7-14.3-32-32-32z"/></svg><span class="menu-item-name">文章</span></a>
                </li>
            
        
            
                <li class="menu-item"><a href="../../categories/"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon categories"><path d="M149.333 56v80c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V56c0-13.255 10.745-24 24-24h101.333c13.255 0 24 10.745 24 24zm181.334 240v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.256 0 24.001-10.745 24.001-24zm32-240v80c0 13.255 10.745 24 24 24H488c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24zm-32 80V56c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.256 0 24.001-10.745 24.001-24zm-205.334 56H24c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24zM0 376v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zm386.667-56H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24zm0 160H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24zM181.333 376v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24z"/></svg><span class="menu-item-name">分类</span></a>
                </li>
            
        
            
                <li class="menu-item"><a href="../../tags/"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" class="icon tags"><path d="M497.941 225.941L286.059 14.059A48 48 0 0 0 252.118 0H48C21.49 0 0 21.49 0 48v204.118a48 48 0 0 0 14.059 33.941l211.882 211.882c18.744 18.745 49.136 18.746 67.882 0l204.118-204.118c18.745-18.745 18.745-49.137 0-67.882zM112 160c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm513.941 133.823L421.823 497.941c-18.745 18.745-49.137 18.745-67.882 0l-.36-.36L527.64 323.522c16.999-16.999 26.36-39.6 26.36-63.64s-9.362-46.641-26.36-63.64L331.397 0h48.721a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882z"/></svg><span class="menu-item-name">标签</span></a>
                </li>
            
        
            
                <li class="menu-item"><a href="../../about/"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" class="icon about"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 96c48.6 0 88 39.4 88 88s-39.4 88-88 88-88-39.4-88-88 39.4-88 88-88zm0 344c-58.7 0-111.3-26.6-146.5-68.2 18.8-35.4 55.6-59.8 98.5-59.8 2.4 0 4.8.4 7.1 1.1 13 4.2 26.6 6.9 40.9 6.9 14.3 0 28-2.7 40.9-6.9 2.3-.7 4.7-1.1 7.1-1.1 42.9 0 79.7 24.4 98.5 59.8C359.3 421.4 306.7 448 248 448z"/></svg><span class="menu-item-name">关于</span></a>
                </li>
            
        
    </ul>
</nav>

                    
                </div>
            </div>
            
    <input type="checkbox" id="nav-toggle" aria-hidden="true" />
    <label for="nav-toggle" class="nav-toggle"></label>
    <label for="nav-toggle" class="nav-curtain"></label>


        
    </header>




            
            
    <main class="main single" id="main">
    <div class="main-inner">

        

        <article class="content post h-entry" data-align="justify" data-type="posts">

            <h1 class="post-title p-name">Nginx 配置文件</h1>

            

            
                
            

            
                

<div class="post-meta">
    
        
        <time datetime="2019-04-03T09:40:29&#43;00:00" class="post-meta-item published dt-published"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon post-meta-icon"><path d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>&nbsp;2019.04.03</time>
    
    
        
        <time datetime="2021-12-14T14:36:01&#43;08:00" class="post-meta-item modified dt-updated"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon post-meta-icon"><path d="M400 64h-48V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v52H160V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v52H48C21.49 64 0 85.49 0 112v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 400H54a6 6 0 0 1-6-6V160h352v298a6 6 0 0 1-6 6zm-52.849-200.65L198.842 404.519c-4.705 4.667-12.303 4.637-16.971-.068l-75.091-75.699c-4.667-4.705-4.637-12.303.068-16.971l22.719-22.536c4.705-4.667 12.303-4.637 16.97.069l44.104 44.461 111.072-110.181c4.705-4.667 12.303-4.637 16.971.068l22.536 22.718c4.667 4.705 4.636 12.303-.069 16.97z"/></svg>&nbsp;2021.12.14</time>
    
    
    
        
        
        
            
                <span class="post-meta-item category"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon post-meta-icon"><path d="M464 128H272l-54.63-54.63c-6-6-14.14-9.37-22.63-9.37H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48zm0 272H48V112h140.12l54.63 54.63c6 6 14.14 9.37 22.63 9.37H464v224z"/></svg>&nbsp;<a href="../../categories/nginx/" class="category-link p-category">Nginx</a></span>
            
        
    
    
        
        <span class="post-meta-item wordcount"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon post-meta-icon"><path d="M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"/></svg>&nbsp;1668</span>
    
    
    
        
            
            <span class="post-meta-item busuanzi-page-pv" id="busuanzi_container_page_pv"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="icon post-meta-icon"><path d="M288 144a110.94 110.94 0 0 0-31.24 5 55.4 55.4 0 0 1 7.24 27 56 56 0 0 1-56 56 55.4 55.4 0 0 1-27-7.24A111.71 111.71 0 1 0 288 144zm284.52 97.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400c-98.65 0-189.09-55-237.93-144C98.91 167 189.34 112 288 112s189.09 55 237.93 144C477.1 345 386.66 400 288 400z"/></svg>&nbsp;<span id="busuanzi_value_page_pv"></span></span>
        
    
    
</div>

            

            <div class="post-body e-content">
                <h2 id="nginx-配置文件"><a href="#nginx-配置文件" class="anchor-link">§</a>nginx 配置文件</h2>
<div class="highlight"><div class="chroma">
<div class="table-container"><table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">  1
</span><span class="lnt">  2
</span><span class="lnt">  3
</span><span class="lnt">  4
</span><span class="lnt">  5
</span><span class="lnt">  6
</span><span class="lnt">  7
</span><span class="lnt">  8
</span><span class="lnt">  9
</span><span class="lnt"> 10
</span><span class="lnt"> 11
</span><span class="lnt"> 12
</span><span class="lnt"> 13
</span><span class="lnt"> 14
</span><span class="lnt"> 15
</span><span class="lnt"> 16
</span><span class="lnt"> 17
</span><span class="lnt"> 18
</span><span class="lnt"> 19
</span><span class="lnt"> 20
</span><span class="lnt"> 21
</span><span class="lnt"> 22
</span><span class="lnt"> 23
</span><span class="lnt"> 24
</span><span class="lnt"> 25
</span><span class="lnt"> 26
</span><span class="lnt"> 27
</span><span class="lnt"> 28
</span><span class="lnt"> 29
</span><span class="lnt"> 30
</span><span class="lnt"> 31
</span><span class="lnt"> 32
</span><span class="lnt"> 33
</span><span class="lnt"> 34
</span><span class="lnt"> 35
</span><span class="lnt"> 36
</span><span class="lnt"> 37
</span><span class="lnt"> 38
</span><span class="lnt"> 39
</span><span class="lnt"> 40
</span><span class="lnt"> 41
</span><span class="lnt"> 42
</span><span class="lnt"> 43
</span><span class="lnt"> 44
</span><span class="lnt"> 45
</span><span class="lnt"> 46
</span><span class="lnt"> 47
</span><span class="lnt"> 48
</span><span class="lnt"> 49
</span><span class="lnt"> 50
</span><span class="lnt"> 51
</span><span class="lnt"> 52
</span><span class="lnt"> 53
</span><span class="lnt"> 54
</span><span class="lnt"> 55
</span><span class="lnt"> 56
</span><span class="lnt"> 57
</span><span class="lnt"> 58
</span><span class="lnt"> 59
</span><span class="lnt"> 60
</span><span class="lnt"> 61
</span><span class="lnt"> 62
</span><span class="lnt"> 63
</span><span class="lnt"> 64
</span><span class="lnt"> 65
</span><span class="lnt"> 66
</span><span class="lnt"> 67
</span><span class="lnt"> 68
</span><span class="lnt"> 69
</span><span class="lnt"> 70
</span><span class="lnt"> 71
</span><span class="lnt"> 72
</span><span class="lnt"> 73
</span><span class="lnt"> 74
</span><span class="lnt"> 75
</span><span class="lnt"> 76
</span><span class="lnt"> 77
</span><span class="lnt"> 78
</span><span class="lnt"> 79
</span><span class="lnt"> 80
</span><span class="lnt"> 81
</span><span class="lnt"> 82
</span><span class="lnt"> 83
</span><span class="lnt"> 84
</span><span class="lnt"> 85
</span><span class="lnt"> 86
</span><span class="lnt"> 87
</span><span class="lnt"> 88
</span><span class="lnt"> 89
</span><span class="lnt"> 90
</span><span class="lnt"> 91
</span><span class="lnt"> 92
</span><span class="lnt"> 93
</span><span class="lnt"> 94
</span><span class="lnt"> 95
</span><span class="lnt"> 96
</span><span class="lnt"> 97
</span><span class="lnt"> 98
</span><span class="lnt"> 99
</span><span class="lnt">100
</span><span class="lnt">101
</span><span class="lnt">102
</span><span class="lnt">103
</span><span class="lnt">104
</span><span class="lnt">105
</span><span class="lnt">106
</span><span class="lnt">107
</span><span class="lnt">108
</span><span class="lnt">109
</span><span class="lnt">110
</span><span class="lnt">111
</span><span class="lnt">112
</span><span class="lnt">113
</span><span class="lnt">114
</span><span class="lnt">115
</span><span class="lnt">116
</span><span class="lnt">117
</span><span class="lnt">118
</span><span class="lnt">119
</span><span class="lnt">120
</span><span class="lnt">121
</span><span class="lnt">122
</span><span class="lnt">123
</span><span class="lnt">124
</span><span class="lnt">125
</span><span class="lnt">126
</span><span class="lnt">127
</span><span class="lnt">128
</span><span class="lnt">129
</span><span class="lnt">130
</span><span class="lnt">131
</span><span class="lnt">132
</span><span class="lnt">133
</span><span class="lnt">134
</span><span class="lnt">135
</span><span class="lnt">136
</span><span class="lnt">137
</span><span class="lnt">138
</span><span class="lnt">139
</span><span class="lnt">140
</span><span class="lnt">141
</span><span class="lnt">142
</span><span class="lnt">143
</span><span class="lnt">144
</span><span class="lnt">145
</span><span class="lnt">146
</span><span class="lnt">147
</span><span class="lnt">148
</span><span class="lnt">149
</span><span class="lnt">150
</span><span class="lnt">151
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-nginx" data-lang="nginx"><span class="c1">#定义Nginx运行的用户和用户组
</span><span class="c1"></span><span class="k">user</span> <span class="s">www</span> <span class="s">www</span><span class="p">;</span>
<span class="c1">#nginx进程数，建议设置为等于CPU总核心数。
</span><span class="c1"></span><span class="k">worker_processes</span> <span class="mi">8</span><span class="p">;</span>

<span class="c1">#全局错误日志定义类型，[ debug | info | notice | warn | error | crit ]
</span><span class="c1"></span><span class="k">error_log</span> <span class="s">/var/log/nginx/error.log</span> <span class="s">info</span><span class="p">;</span>

<span class="c1">#进程文件
</span><span class="c1"></span><span class="k">pid</span> <span class="s">/var/run/nginx.pid</span><span class="p">;</span>

<span class="c1">#一个nginx进程打开的最多文件描述符数目，理论值应该是最多打开文件数（系统的值ulimit -n）与nginx进程数相除，
</span><span class="c1"></span><span class="k">但是nginx分配请求并不均匀，所以建议与ulimit</span> <span class="s">-n的值保持一致。</span>
<span class="s">worker_rlimit_nofile</span> <span class="mi">65535</span><span class="p">;</span>

<span class="c1">#工作模式与连接数上限
</span><span class="c1"></span><span class="k">events</span>
<span class="p">{</span>
    <span class="c1">#参考事件模型，use [ kqueue | rtsig | epoll | /dev/poll | select | poll ]; epoll模型是
</span><span class="c1"></span>    <span class="kn">Linux</span> <span class="mi">2</span><span class="s">.6以上版本内核中的高性能网络I/O模型，如果跑在FreeBSD上面，就用kqueue模型。</span>
    <span class="s">use</span> <span class="s">epoll</span><span class="p">;</span>
    <span class="c1">#单个进程最大连接数（最大连接数=连接数*进程数）
</span><span class="c1"></span>    <span class="kn">worker_connections</span> <span class="mi">65535</span><span class="p">;</span>
<span class="p">}</span>

<span class="c1">#设定http服务器
</span><span class="c1"></span><span class="k">http</span>
<span class="p">{</span>
    <span class="kn">include</span> <span class="s">mime.types</span><span class="p">;</span> <span class="c1">#文件扩展名与文件类型映射表
</span><span class="c1"></span>    <span class="kn">default_type</span> <span class="s">application/octet-stream</span><span class="p">;</span> <span class="c1">#默认文件类型
</span><span class="c1"></span>    <span class="c1">#charset utf-8; #默认编码
</span><span class="c1"></span>    <span class="kn">server_names_hash_bucket_size</span> <span class="mi">128</span><span class="p">;</span> <span class="c1">#服务器名字的hash表大小
</span><span class="c1"></span>    <span class="kn">client_header_buffer_size</span> <span class="mi">32k</span><span class="p">;</span> <span class="c1">#上传文件大小限制
</span><span class="c1"></span>    <span class="kn">large_client_header_buffers</span> <span class="mi">4</span> <span class="mi">64k</span><span class="p">;</span> <span class="c1">#设定请求缓
</span><span class="c1"></span>    <span class="kn">client_max_body_size</span> <span class="mi">8m</span><span class="p">;</span> <span class="c1">#设定请求缓
</span><span class="c1"></span>    <span class="kn">sendfile</span> <span class="no">on</span><span class="p">;</span> <span class="c1">#开启高效文件传输模式，sendfile指令指定nginx是否调用sendfile函数来输出文件，
</span><span class="c1"></span>    <span class="kn">对于普通应用设为</span> <span class="no">on</span><span class="s">，如果用来进行下载等应用磁盘IO重负载应用，可设置为off，以平衡磁盘与网络I/O处理</span>
    <span class="s">速度，降低系统的负载。注意：如果图片显示不正常把这个改成off。</span>
    <span class="s">autoindex</span> <span class="no">on</span><span class="p">;</span> <span class="c1">#开启目录列表访问，合适下载服务器，默认关闭。
</span><span class="c1"></span>    <span class="kn">tcp_nopush</span> <span class="no">on</span><span class="p">;</span> <span class="c1">#防止网络阻塞
</span><span class="c1"></span>    <span class="kn">tcp_nodelay</span> <span class="no">on</span><span class="p">;</span> <span class="c1">#防止网络阻塞
</span><span class="c1"></span>    <span class="kn">keepalive_timeout</span> <span class="mi">120</span><span class="p">;</span> <span class="c1">#长连接超时时间，单位是秒
</span><span class="c1"></span>
<span class="c1">#FastCGI相关参数是为了改善网站的性能：减少资源占用，提高访问速度。下面参数看字面意思都能理解。
</span><span class="c1"></span>    <span class="kn">fastcgi_connect_timeout</span> <span class="mi">300</span><span class="p">;</span>
    <span class="kn">fastcgi_send_timeout</span> <span class="mi">300</span><span class="p">;</span>
    <span class="kn">fastcgi_read_timeout</span> <span class="mi">300</span><span class="p">;</span>
    <span class="kn">fastcgi_buffer_size</span> <span class="mi">64k</span><span class="p">;</span>
    <span class="kn">fastcgi_buffers</span> <span class="mi">4</span> <span class="mi">64k</span><span class="p">;</span>
    <span class="kn">fastcgi_busy_buffers_size</span> <span class="mi">128k</span><span class="p">;</span>
    <span class="kn">fastcgi_temp_file_write_size</span> <span class="mi">128k</span><span class="p">;</span>

<span class="c1">#gzip模块设置
</span><span class="c1"></span>    <span class="kn">gzip</span> <span class="no">on</span><span class="p">;</span> <span class="c1">#开启gzip压缩输出
</span><span class="c1"></span>    <span class="kn">gzip_min_length</span> <span class="mi">1k</span><span class="p">;</span> <span class="c1">#最小压缩文件大小
</span><span class="c1"></span>    <span class="kn">gzip_buffers</span> <span class="mi">4</span> <span class="mi">16k</span><span class="p">;</span> <span class="c1">#压缩缓冲区
</span><span class="c1"></span>    <span class="kn">gzip_http_version</span> <span class="mi">1</span><span class="s">.0</span><span class="p">;</span> <span class="c1">#压缩版本（默认1.1，前端如果是squid2.5请使用1.0）
</span><span class="c1"></span>    <span class="kn">gzip_comp_level</span> <span class="mi">2</span><span class="p">;</span> <span class="c1">#压缩等级
</span><span class="c1"></span>    <span class="kn">gzip_types</span> <span class="s">text/plain</span> <span class="s">application/x-javascript</span> <span class="s">text/css</span> <span class="s">application/xml</span><span class="p">;</span>
<span class="c1">#压缩类型，默认就已经包含text/html，所以下面就不用再写了，写上去也不会有问题，但是会有一个warn。
</span><span class="c1"></span>    <span class="kn">gzip_vary</span> <span class="no">on</span><span class="p">;</span>

<span class="c1">#limit_zone crawler $binary_remote_addr 10m; #开启限制IP连接数的时候需要使用
</span><span class="c1"></span>
    <span class="kn">upstream</span> <span class="s">test.com</span> <span class="p">{</span>
<span class="c1">#upstream的负载均衡，weight是权重，可以根据机器配置定义权重。weigth参数表示权值，权值越高被
</span><span class="c1"></span><span class="kn">分配到的几率越大。</span>
        <span class="s">server</span> <span class="n">192.168.80.121</span><span class="p">:</span><span class="mi">80</span> <span class="s">weight=3</span><span class="p">;</span>
        <span class="kn">server</span> <span class="n">192.168.80.122</span><span class="p">:</span><span class="mi">80</span> <span class="s">weight=2</span><span class="p">;</span>
        <span class="kn">server</span> <span class="n">192.168.80.123</span><span class="p">:</span><span class="mi">80</span> <span class="s">weight=3</span><span class="p">;</span>
<span class="p">}</span>

<span class="c1">#虚拟主机的配置
</span><span class="c1"></span><span class="kn">server</span>
<span class="p">{</span>
    <span class="c1">#监听端口
</span><span class="c1"></span>    <span class="kn">listen</span> <span class="mi">80</span><span class="p">;</span>
    <span class="c1">#域名可以有多个，用空格隔开
</span><span class="c1"></span>    <span class="kn">server_name</span> <span class="s">www.ha97.com</span> <span class="s">ha97.com</span><span class="p">;</span>
    <span class="kn">index</span> <span class="s">index.html</span> <span class="s">index.htm</span> <span class="s">index.php</span><span class="p">;</span>
    <span class="kn">root</span> <span class="s">/data/www/ha97</span><span class="p">;</span>
    <span class="kn">location</span> <span class="p">~</span> <span class="sr">.*.(php|php5)?$</span>
    <span class="p">{</span>
        <span class="kn">fastcgi_pass</span> <span class="n">127.0.0.1</span><span class="p">:</span><span class="mi">9000</span><span class="p">;</span>
        <span class="kn">fastcgi_index</span> <span class="s">index.php</span><span class="p">;</span>
        <span class="kn">include</span> <span class="s">fastcgi.conf</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">#图片缓存时间设置
</span><span class="c1"></span>    <span class="kn">location</span> <span class="p">~</span> <span class="sr">.*.(gif|jpg|jpeg|png|bmp|swf)$</span>
    <span class="p">{</span>
        <span class="kn">expires</span> <span class="s">10d</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">#JS和CSS缓存时间设置
</span><span class="c1"></span>    <span class="kn">location</span> <span class="p">~</span> <span class="sr">.*.(js|css)?$</span>
    <span class="p">{</span>
        <span class="kn">expires</span> <span class="s">1h</span><span class="p">;</span>
    <span class="p">}</span>
<span class="c1">#日志格式设定
</span><span class="c1"></span>    <span class="kn">log_format</span> <span class="s">access</span> <span class="s">&#39;</span><span class="nv">$remote_addr</span> <span class="s">-</span> <span class="nv">$remote_user</span> <span class="s">[</span><span class="nv">$time_local]</span> <span class="s">&#34;</span><span class="nv">$request&#34;</span> <span class="s">&#39;</span>
    <span class="s">&#39;</span><span class="nv">$status</span> <span class="nv">$body_bytes_sent</span> <span class="s">&#34;</span><span class="nv">$http_referer&#34;</span> <span class="s">&#39;</span>
    <span class="s">&#39;&#34;</span><span class="nv">$http_user_agent&#34;</span> <span class="nv">$http_x_forwarded_for&#39;</span><span class="p">;</span>
<span class="c1">#定义本虚拟主机的访问日志
</span><span class="c1"></span>    <span class="kn">access_log</span> <span class="s">/var/log/nginx/ha97access.log</span> <span class="s">access</span><span class="p">;</span>

<span class="c1">#对 &#34;/&#34; 启用反向代理
</span><span class="c1"></span>    <span class="kn">location</span> <span class="s">/</span> <span class="p">{</span>
        <span class="kn">proxy_pass</span> <span class="s">http://127.0.0.1:88</span><span class="p">;</span>
        <span class="kn">proxy_redirect</span> <span class="no">off</span><span class="p">;</span>
        <span class="kn">proxy_set_header</span> <span class="s">X-Real-IP</span> <span class="nv">$remote_addr</span><span class="p">;</span>
<span class="c1">#后端的Web服务器可以通过X-Forwarded-For获取用户真实IP
</span><span class="c1"></span>        <span class="kn">proxy_set_header</span> <span class="s">X-Forwarded-For</span> <span class="nv">$proxy_add_x_forwarded_for</span><span class="p">;</span>
<span class="c1">#以下是一些反向代理的配置，可选。
</span><span class="c1"></span>        <span class="kn">proxy_set_header</span> <span class="s">Host</span> <span class="nv">$host</span><span class="p">;</span>
        <span class="kn">client_max_body_size</span> <span class="mi">10m</span><span class="p">;</span> <span class="c1">#允许客户端请求的最大单文件字节数
</span><span class="c1"></span>        <span class="kn">client_body_buffer_size</span> <span class="mi">128k</span><span class="p">;</span> <span class="c1">#缓冲区代理缓冲用户端请求的最大字节数，
</span><span class="c1"></span>        <span class="kn">proxy_connect_timeout</span> <span class="mi">90</span><span class="p">;</span> <span class="c1">#nginx跟后端服务器连接超时时间(代理连接超时)
</span><span class="c1"></span>        <span class="kn">proxy_send_timeout</span> <span class="mi">90</span><span class="p">;</span> <span class="c1">#后端服务器数据回传时间(代理发送超时)
</span><span class="c1"></span>        <span class="kn">proxy_read_timeout</span> <span class="mi">90</span><span class="p">;</span> <span class="c1">#连接成功后，后端服务器响应时间(代理接收超时)
</span><span class="c1"></span>        <span class="kn">proxy_buffer_size</span> <span class="mi">4k</span><span class="p">;</span> <span class="c1">#设置代理服务器（nginx）保存用户头信息的缓冲区大小
</span><span class="c1"></span>        <span class="kn">proxy_buffers</span> <span class="mi">4</span> <span class="mi">32k</span><span class="p">;</span> <span class="c1">#proxy_buffers缓冲区，网页平均在32k以下的设置
</span><span class="c1"></span>        <span class="kn">proxy_busy_buffers_size</span> <span class="mi">64k</span><span class="p">;</span> <span class="c1">#高负荷下缓冲大小（proxy_buffers*2）
</span><span class="c1"></span>        <span class="kn">proxy_temp_file_write_size</span> <span class="mi">64k</span><span class="p">;</span>
        <span class="c1">#设定缓存文件夹大小，大于这个值，将从upstream服务器传
</span><span class="c1"></span>    <span class="p">}</span>

<span class="c1">#设定查看Nginx状态的地址
</span><span class="c1"></span>    <span class="kn">location</span> <span class="s">/NginxStatus</span> <span class="p">{</span>
        <span class="kn">stub_status</span> <span class="no">on</span><span class="p">;</span>
        <span class="kn">access_log</span> <span class="no">on</span><span class="p">;</span>
        <span class="kn">auth_basic</span> <span class="s">&#34;NginxStatus&#34;</span><span class="p">;</span>
        <span class="kn">auth_basic_user_file</span> <span class="s">conf/htpasswd</span><span class="p">;</span>
    <span class="c1">#htpasswd文件的内容可以用apache提供的htpasswd工具来产生。
</span><span class="c1"></span>    <span class="p">}</span>

<span class="c1">#本地动静分离反向代理配置
</span><span class="c1">#所有jsp的页面均交由tomcat或resin处理
</span><span class="c1"></span>    <span class="kn">location</span> <span class="p">~</span> <span class="sr">.(jsp|jspx|do)?$</span> <span class="p">{</span>
        <span class="kn">proxy_set_header</span> <span class="s">Host</span> <span class="nv">$host</span><span class="p">;</span>
        <span class="kn">proxy_set_header</span> <span class="s">X-Real-IP</span> <span class="nv">$remote_addr</span><span class="p">;</span>
        <span class="kn">proxy_set_header</span> <span class="s">X-Forwarded-For</span> <span class="nv">$proxy_add_x_forwarded_for</span><span class="p">;</span>
        <span class="kn">proxy_pass</span> <span class="s">http://127.0.0.1:8080</span><span class="p">;</span>
    <span class="p">}</span>
<span class="c1">#所有静态文件由nginx直接读取不经过tomcat或resin
</span><span class="c1"></span>    <span class="kn">location</span> <span class="p">~</span> <span class="sr">.*.(htm|html|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt</span>
<span class="s">|flv|mid|doc|ppt|pdf|xls|mp3|wma)</span><span class="nv">${</span>
        <span class="s">expires</span> <span class="s">15d</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="kn">location</span> <span class="p">~</span> <span class="sr">.*.(js|css)?$</span><span class="p">{</span>
        <span class="kn">expires</span> <span class="s">1h</span><span class="p">;</span> <span class="p">}</span>
    <span class="p">}</span>
<span class="k">}</span>
</code></pre></td></tr></table></div>
</div>
</div>
            </div>

            


        </article>

        

        


        


        <div class="post-share">

        
            <div class="share-text">分享：</div>
        

        <div class="share-items">

            

            

            

            
                <div class="share-item telegram">
                    
                    <a href="https://t.me/share/url?url=http://blog.phpst.cn/posts/nginx%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/&amp;text=Nginx%20%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6" title="分享到「Telegram」" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" class="icon telegram-icon"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm121.8 169.9l-40.7 191.8c-3 13.6-11.1 16.9-22.4 10.5l-62-45.7-29.9 28.8c-3.3 3.3-6.1 6.1-12.5 6.1l4.4-63.1 114.9-103.8c5-4.4-1.1-6.9-7.7-2.5l-142 89.4-61.2-19.1c-13.3-4.2-13.6-13.3 2.8-19.7l239.1-92.2c11.1-4 20.8 2.7 17.2 19.5z"/></svg></a>
                </div>
            

            

            

            
                <div class="share-item qq">
                    
                    <a href="https://connect.qq.com/widget/shareqq/index.html?url=http://blog.phpst.cn/posts/nginx%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/&amp;title=Nginx%20%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6&amp;summary=nginx%20%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%201%202%203%204%205%206%207%208%209%2010%2011%2012%2013%2014%2015%2016%2017%2018%2019%2020%2021%2022%2023%2024%2025%2026%2027%2028%2029%2030%2031%2032%2033%2034%2035%2036%2037%e2%80%a6%e2%80%a6&amp;pics=http://blog.phpst.cn/icons/apple-touch-icon.png&amp;site=%e5%be%90%e6%9b%99%e8%be%89%e4%b8%aa%e4%ba%ba%e5%8d%9a%e5%ae%a2" title="分享到「QQ」" target="_blank" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon qq-icon"><path d="M433.754 420.445c-11.526 1.393-44.86-52.741-44.86-52.741 0 31.345-16.136 72.247-51.051 101.786 16.842 5.192 54.843 19.167 45.803 34.421-7.316 12.343-125.51 7.881-159.632 4.037-34.122 3.844-152.316 8.306-159.632-4.037-9.045-15.25 28.918-29.214 45.783-34.415-34.92-29.539-51.059-70.445-51.059-101.792 0 0-33.334 54.134-44.859 52.741-5.37-.65-12.424-29.644 9.347-99.704 10.261-33.024 21.995-60.478 40.144-105.779C60.683 98.063 108.982.006 224 0c113.737.006 163.156 96.133 160.264 214.963 18.118 45.223 29.912 72.85 40.144 105.778 21.768 70.06 14.716 99.053 9.346 99.704z"/></svg></a>
                </div>
            

            

            
                <div class="share-item qrcode">
                    <div class="qrcode-container" title="通过「二维码」"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon qrcode-icon"><path d="M0 224h192V32H0v192zM64 96h64v64H64V96zm192-64v192h192V32H256zm128 128h-64V96h64v64zM0 480h192V288H0v192zm64-128h64v64H64v-64zm352-64h32v128h-96v-32h-32v96h-64V288h96v32h64v-32zm0 160h32v32h-32v-32zm-64 0h32v32h-32v-32z"/></svg><div id="qrcode-img"></div>
                    </div>
                    <script src="https://cdn.jsdelivr.net/npm/qrcode-generator@1.4.4/qrcode.min.js"></script>

<script>
    var typeNumber = 0;
    var errorCorrectionLevel = 'L';
    var qr = qrcode(typeNumber, errorCorrectionLevel);
    qr.addData('http:\/\/blog.phpst.cn\/posts\/nginx%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6\/');
    qr.make();
    document.getElementById('qrcode-img').innerHTML = qr.createImgTag();
</script>

                </div>
            

        </div>

    </div>




        
    
    
        <div class="related-posts">
            <h2 class="related-title">相关文章：<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon related-icon"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"/></svg></h2>
            <ul class="related-list">
                
                    <li class="related-item">
                        <a href="../../posts/nginx%E9%85%8D%E7%BD%AEsocket.io%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/" class="related-link">Nginx 配置 Socket.IO 负载均衡</a>
                    </li>
                
            </ul>
        </div>
    



        
    
        <div class="post-tags">
            
                
                
                
                
                    
                    <a href="../../tags/nginx/" rel="tag" class="post-tags-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon tag-icon"><path d="M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z"/></svg>Nginx</a>
                
            
        </div>
    



        


        


        
    
        
        
    
    
    
    
        <ul class="post-nav">
            
                <li class="post-nav-prev">
                    <a href="../../posts/nginx%E9%85%8D%E7%BD%AEsocket.io%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/" rel="prev">&lt; Nginx 配置 Socket.IO 负载均衡</a>
                </li>
            
            
                <li class="post-nav-next">
                    <a href="../../posts/python%E5%9C%A8%E7%B1%BB%E4%B8%AD%E5%AE%9E%E7%8E%B0swith%E5%8A%9F%E8%83%BD/" rel="next">Python 在类中实现 swith 功能 &gt;</a>
                </li>
            
        </ul>
    



        
    

        
            <div class="load-comments">
                <div id="load-comments">加载评论</div>
            </div>
        

        

        

        
            <div id="utterances"></div>
        

        
    



    </div>
</main>


            
    <div id="back-to-top" class="back-to-top">
        <a href="#"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon arrow-up"><path d="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"/></svg></a>
    </div>


            
    <footer id="footer" class="footer">
        <div class="footer-inner">
            <div class="site-info">2019–2022&nbsp;<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="icon footer-icon"><path d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"/></svg>&nbsp;</div><div class="custom-footer">Powered by <a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a> | Theme is <a href="https://github.com/reuixiy/hugo-theme-meme" target="_blank" rel="noopener">MemE</a> | © <a href="../../license.txt">WTFPL</a></div>
                <div class="busuanzi-site-uv-and-pv">
                    <span id="busuanzi_container_site_uv">本站访客数&nbsp;<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon busuanzi-site-uv"><path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/></svg>&nbsp;<span id="busuanzi_value_site_uv"></span></span>&nbsp;|&nbsp;<span id="busuanzi_container_site_pv">本站访问量&nbsp;<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="icon busuanzi-site-pv"><path d="M288 144a110.94 110.94 0 0 0-31.24 5 55.4 55.4 0 0 1 7.24 27 56 56 0 0 1-56 56 55.4 55.4 0 0 1-27-7.24A111.71 111.71 0 1 0 288 144zm284.52 97.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400c-98.65 0-189.09-55-237.93-144C98.91 167 189.34 112 288 112s189.09 55 237.93 144C477.1 345 386.66 400 288 400z"/></svg>&nbsp;<span id="busuanzi_value_site_pv"></span></span>
                </div>

            


            
        </div>
    </footer>


        </div>
        

        






    

        

        

        
            <script>
    function loadComments() {
        (function() {
            var utterances = document.getElementById("utterances");
            var script = document.createElement('script');
            script.src = 'https://utteranc.es/client.js';
            script.async = true;
            script.crossOrigin = 'anonymous';
            script.setAttribute('repo', 'he-sb\/blog-comments');
            script.setAttribute('issue-term', 'title');
            const isDark = getCurrentTheme() === 'dark';
        if (isDark) {
            script.setAttribute('theme', 'photon-dark');
        } else {
            script.setAttribute('theme', 'github-light');
        }
            
                script.setAttribute('label', '💬疯言疯语');
            
            utterances.appendChild(script);
        })();
    }
</script>
        

        

    



    <script src="https://cdn.jsdelivr.net/npm/medium-zoom@latest/dist/medium-zoom.min.js"></script>

<script>
    let imgNodes = document.querySelectorAll('div.post-body img');
    imgNodes = Array.from(imgNodes).filter(node => node.parentNode.tagName !== "A");

    mediumZoom(imgNodes, {
        background: 'hsla(var(--color-bg-h), var(--color-bg-s), var(--color-bg-l), 0.95)'
    })
</script>




    <script src="https://cdn.jsdelivr.net/npm/instant.page@5.1.0/instantpage.min.js" type="module" defer></script>




    
        <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    




    </body>
</html>
